<tagLib name="html" />
<script language="javascript" src="/Public/static/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<div id="main-content">
    <div id="main" class="main">
        <!-- 修改密码 start -->
        <div class="spin-cont">
            <div class="user-hd">
                <h2>{$page_title}</h2>
            </div>
            <div class="user_zl">
                <form name="data_form" id="data_form" method="POST">
				<fieldset>
				<legend>当前计费详情</legend>
                <dl class="clearfix">
                    <dt>计费周期：</dt>
                    <dd>
                        <if condition="1 NEQ $is_add">
                            {$model.period_count}
                            <input type="hidden" id="period_count" name="period_count" value="{$model.period_count}" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" maxlength="2" autocomplete="off" class="bg-input w229"/> 月
                        <else/>
                            <input type="text" id="period_count" name="period_count" value="{$model.period_count}" placeholder="请输入合同周期的月数，最大为数字99" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" maxlength="2" autocomplete="off" class="bg-input w229"/> 月
                        </if>
                    </dd>
                    <dd class="error_message" id="message_period_count"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费金额：</dt>
                    <dd>
                        {$model.hall_price}
                        <input type="hidden" id="hall_price" name="hall_price" value="{$model.hall_price}" maxlength="2" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" autocomplete="off" class="bg-input w229"/> 元 / 间 - 月
                    </dd>
                    <dd class="error_message" id="message_hall_price"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>授权房间：</dt>
                    <dd>
                        {$model.buy_hall_count}
                        <input type="hidden" id="buy_hall_count" name="buy_hall_count" value="{$model.buy_hall_count}" onkeyup="calculatePeriodMoney()" onblur="calculatePeriodMoney()" maxlength="2" autocomplete="off" class="bg-input w229"/> 间
                    </dd>
                    <dd class="error_message" id="message_buy_hall_count"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>扣费周期：</dt>
                    <dd>
                        {$deduct_period_options[$model[deduct_period]]}
                        <div style="display: none;">
                        <html:select options="deduct_period_options" name="deduct_period" id="deduct_period" change="calculatePeriodMoney()" selected="model[deduct_period]" />
                        </div>
                    </dd>
                    <dd class="error_message" id="message_deduct_period"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>本期扣费截止日期：</dt>
                    <dd><?php echo date("Y-m-d",$model['last_cost_time']+($model['deduct_period']*31*86400));  ?></dd>
                </dl>				
                <dl class="clearfix">
                    <dt>每期扣费总计：</dt>
                    <dd id="period_money"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费总计：</dt>
                    <dd id="total_money"></dd>
                </dl>
				</fieldset>
				
				<fieldset>
				<legend>计费变更</legend>				
                <dl class="clearfix">
                    <dt>计费金额：</dt>
                    <dd>
                        <input type="text" id="hall_price_next" name="hall_price_next" value="<if condition="0 LT $model[hall_price_next]">{$model.hall_price_next}</if>" maxlength="5" placeholder="请填写计费金额" onkeyup="calculatePeriodMoneyNext()" onblur="calculatePeriodMoneyNext()" autocomplete="off" class="bg-input w229"/> 元 / 间 - 月
                    </dd>
                    <dd class="error_message" id="message_hall_price_next"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费周期：</dt>
                    <dd>
                        <input type="text" id="period_count_next" name="period_count_next" value="<if condition="0 LT $model[period_count_next]">{$model.period_count_next}</if>" placeholder="请输入合同周期的月数，最大为数字99" onkeyup="calculatePeriodMoneyNext()" onblur="calculatePeriodMoneyNext()" maxlength="2" autocomplete="off" class="bg-input w229"/> 月
                    </dd>
                    <dd class="error_message" id="message_period_count_next"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>授权房间：</dt>
                    <dd>
                        <input type="text" id="buy_hall_count_next" name="buy_hall_count_next" value="<if condition="0 LT $model[buy_hall_count_next]">{$model.buy_hall_count_next}</if>" placeholder="请输入授权房间数量，最大为数字99" onkeyup="calculatePeriodMoneyNext()" onblur="calculatePeriodMoneyNext()" maxlength="2" autocomplete="off" class="bg-input w229"/> 间
                    </dd>
                    <dd class="error_message" id="message_buy_hall_count_next"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>扣费周期：</dt>
                    <dd>
                        <html:select options="deduct_period_options" name="deduct_period_next" id="deduct_period_next" change="calculatePeriodMoneyNext()" selected="model[deduct_period_next]" />
                    </dd>
                    <dd class="error_message" id="message_deduct_period_next"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>每期扣费总计：</dt>
                    <dd id="period_money_next"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>计费总计：</dt>
                    <dd id="total_money_next"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>备注：</dt>
                    <dd><textarea id="remark_next" name="remark_next" class="bg-textarea w229" maxlength="100">{$model.remark_next}</textarea></dd>
                </dl>
                <dl class="clearfix">
                    <dt></dt>
                    <dd>
                        <a href="javascript:;" class="gray-btn" onclick="changeRecharge()">确定</a>
						<a href="javascript:;" class="gray-btn" onclick="reset('data_form')">取消</a>
                        <input type="hidden" name="id" value="{$id}" />
                    </dd>
                </dl>
				</fieldset>
                </form>
            </div>
        </div>
    </div>
</div>
<script language="javascript">
    $(document).ready(function(){
        
        //计算金额总计
        calculatePeriodMoney();
        
        //计算金额总计_下次
        calculatePeriodMoneyNext();
    });
</script>